package com.ruoyi.sumorder.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.sumorder.domain.SumOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sumorder.mapper.CheOrderMapper;
import com.ruoyi.sumorder.domain.CheOrder;
import com.ruoyi.sumorder.service.ICheOrderService;

/**
 * 订单统计Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-03
 */
@Service
public class CheOrderServiceImpl implements ICheOrderService 
{
    @Autowired
    private CheOrderMapper cheOrderMapper;

    @Override
    public List<SumOrder> selectByServiceAndArea(SumOrder sumOrder) {
        return cheOrderMapper.selectAreaServicesList(sumOrder);
    }

    /**
     * 查询订单统计
     * 
     * @param id 订单统计主键
     * @return 订单统计
     */
    @Override
    public CheOrder selectCheOrderById(Long id)
    {
        return cheOrderMapper.selectCheOrderById(id);
    }

    /**
     * 查询订单统计列表
     * 
     * @param cheOrder 订单统计
     * @return 订单统计
     */
    @Override
    public List<CheOrder> selectCheOrderList(CheOrder cheOrder)
    {
        return cheOrderMapper.selectCheOrderList(cheOrder);
    }

    /**
     * 新增订单统计
     * 
     * @param cheOrder 订单统计
     * @return 结果
     */
    @Override
    public int insertCheOrder(CheOrder cheOrder)
    {
        cheOrder.setCreateTime(DateUtils.getNowDate());
        return cheOrderMapper.insertCheOrder(cheOrder);
    }

    /**
     * 修改订单统计
     * 
     * @param cheOrder 订单统计
     * @return 结果
     */
    @Override
    public int updateCheOrder(CheOrder cheOrder)
    {
        return cheOrderMapper.updateCheOrder(cheOrder);
    }

    /**
     * 批量删除订单统计
     * 
     * @param ids 需要删除的订单统计主键
     * @return 结果
     */
    @Override
    public int deleteCheOrderByIds(Long[] ids)
    {
        return cheOrderMapper.deleteCheOrderByIds(ids);
    }

    /**
     * 删除订单统计信息
     * 
     * @param id 订单统计主键
     * @return 结果
     */
    @Override
    public int deleteCheOrderById(Long id)
    {
        return cheOrderMapper.deleteCheOrderById(id);
    }
}
